<?php

class Application_Model_Media extends Zend_Db_Table_Abstract
{
    protected $_name = 'media';
    public function getAllMedia() {
        $select = $this->select()
                       ->from($this->_name);
        return $this->fetchAll($select)->toArray();
    }
    
    public function getSelectMedia($id) {
        $select = $this->select()
                       ->from($this->_name)
                       ->where('id = ?', intval($id));
        return $this->fetchAll($select)->toArray();
    }
    
    public function addMedia($data) {
        $this->insert($data);
    }
    
    public function updateMedia($id, $data) {
        $this->update($data, 'id =' . intval($id));
    }
    
    public function deleteMedia($id) {
        $this->delete('id =' . intval($id));
    }
}

